package com.sf.marathon.soul.core.base;

/**
 * <p>
 * 操作类型
 * </p>
 *
 * @author liutao
 *         2017/6/19 16:19
 */
public enum OperationTypeEnum {
    ADD("A", "新增"), UPDATE("U", "修改"), DELETE("D", "删除");

    private final String value;
    private final String info;

    OperationTypeEnum(String value, String info) {
        this.value = value;
        this.info = info;
    }

    public static OperationTypeEnum getByValue(String value) {
        OperationTypeEnum ret = null;
        for (OperationTypeEnum o : OperationTypeEnum.values()) {
            if (o.value().equals(value)) {
                ret = o;
            }
        }

        return ret;
    }

    public String info() {
        return info;
    }

    public String value() {
        return value;
    }

}
